<!DOCTYPE html>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<meta name="Description" content="This page complements the main page about Building and Running with information that is specific to individual devices. With the current release, it is possible to build for Nexus 4, Nexus 7, and for some variants of Galaxy Nexus. The exact level of functionality…">

<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
<title>Building for devices | Android Open Source Project</title>

<!-- STYLESHEETS -->
<link rel="stylesheet"
href="//fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic,bold" title="roboto">
<link href="/assets/css/default.css" rel="stylesheet" type="text/css">



<!-- JAVASCRIPT -->
<script src="//www.google.com/jsapi" type="text/javascript"></script>
<script src="/assets/js/android_3p-bundle.js" type="text/javascript"></script>
<script type="text/javascript">
  var toRoot = "/";
  
  var devsite = false;
  
</script>
<script src="/assets/js/docs.js" type="text/javascript"></script>


<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-45455297-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
</script>
</head>

<body class="gc-documentation 
  " itemscope itemtype="http://schema.org/Article">
<a name="top"></a>

  
    <!-- Header -->
    <div id="header">
        <div class="wrap" id="header-wrap">
          <div class="col-3 saclogo">
          <a href="/index.html">
            <img src="/assets/images/sac_logo.png"
                srcset="/assets/images/sac_logo@2x.png 2x"
                width="123" height="25" alt="Android Developers" />
          </a>
          </div>
            <ul class="nav-x col-9">
                <li class="source">
                  <a href="/source/index.html" class="selected"
                  >Source</a></li>
                <li class="devices"><a href="/devices/index.html" 
                  >Devices</a></li>
                <li class="accessories"><a href="/accessories/index.html" 
                  >Accessories</a></li>
                <li class="compatibility last"><a href="/compatibility/index.html" 
                  >Compatibility</a></li>
            </ul>
            <!-- New Search -->
            <div class="menu-container">
            <div class="moremenu">
    <div id="more-btn"></div>
  </div>
  <div class="morehover" id="moremenu">
    <div class="top"></div>
    <div class="mid">
      <div class="header">Android Sites</div>
      <ul>
        <li class="active"><a>Android Open Source Project</a></li>
        <li><a href="http://www.android.com">Android.com</a></li>
        <li><a href="http://developer.android.com">Android Developers</a></li>
      </ul>
      <!-- <div class="header">Support</div>
      <ul>
        <li><a href="/support.html">Developer Support</a></li>
      </ul> -->
      <br class="clearfix" />
    </div>
    <div class="bottom"></div>
  </div>

  <div class="search" id="search-container">
    <div class="search-inner">
      <div id="search-btn"></div>
      <div class="left"></div>
      <form onsubmit="return submit_search()">
        <input id="search_autocomplete" type="text" value="" autocomplete="off" name="q"
onfocus="search_focus_changed(this, true)" onblur="search_focus_changed(this, false)"
onkeydown="return search_changed(event, true, '/')"
onkeyup="return search_changed(event, false, '/')" />
      </form>
      <div class="right"></div>
        <a class="close hide">close</a>
        <div class="left"></div>
        <div class="right"></div>
    </div>
  </div>
  <div id="search_filtered_wrapper">
    <div id="search_filtered_div" class="no-display">
        <ul id="search_filtered">
        </ul>
    </div>
  </div>

  </div>
  <!-- /New Search> -->
        </div>
    </div>
    <!-- /Header -->

  <div id="searchResults" class="wrap" style="display:none;">
          <h2 id="searchTitle">Results</h2>
          <div id="leftSearchControl" class="search-control">Loading...</div>
  </div>

  
  
  
    
  <div class="wrap clearfix" id="body-content">
    <div class="col-4" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
      <div id="devdoc-nav" class="scroll-pane">
<a class="totop" href="#top" data-g-event="left-nav-top">to top</a>

<!--
    Copyright 2013 The Android Open Source Project

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<ul id="nav">
  <li class="nav-section">
    <div class="nav-section-header">
      <a href="/source/index.html">
        <span class="en">Overview</span>
      </a>
    </div>
    <ul>
      <li><a href="/source/code-lines.html">Codelines, Branches, and Releases</a></li>
      <li><a href="/source/build-numbers.html">Codenames, Tags, and Build Numbers</a></li>
      <li><a href="/source/roles.html">Project Roles</a></li>
      <li><a href="/source/brands.html">Brand Guidelines</a></li>
      <li><a href="/source/licenses.html">Licenses</a></li>
      <li><a href="/source/faqs.html">FAQ</a></li>
    </ul>
  </li>


  <li class="nav-section">
      <div class="nav-section-header">
        <a href="/source/building.html">
          <span class="en">Downloading and Building</span>
        </a>
      </div>
       <ul>
        <li><a href="/source/initializing.html">Initializing the Build Environment</a></li>
        <li><a href="/source/downloading.html">Downloading the Source</a></li>
        <li><a href="/source/building-running.html">Building and Running</a></li>
        <li><a href="/source/building-devices.html">Building for Devices</a></li>
        <li><a href="/source/building-kernels.html">Building Kernels</a></li>
        <li><a href="/source/64-bit-builds.html">64-bit Build Instructions</a></li>
        <li><a href="/source/known-issues.html">Known Issues</a></li>
      </ul>
  </li>
  <li class="nav-section">
          <div class="nav-section-header">
            <a href="/source/developing.html">
              <span class="en">Developing</span>
            </a>
          </div>
          <ul>
            <li><a href="/source/using-repo.html">Using Repo</a></li>
            <li><a href="/source/using-eclipse.html">Using Eclipse</a></li>
            <li><a href="/source/git-resources.html">Git Resources</a></li>
          </ul>
  </li>

  <li class="nav-section">
    <div class="nav-section-header">
      <a href="/source/contributing.html">
        <span class="en">Contributing</span>
      </a>
    </div>
       <ul>
        <li><a href="/source/life-of-a-patch.html">Life of a Patch</a>
        <li><a href="/source/submit-patches.html">Submitting Patches</a></li>
        <li><a href="http://android-review.googlesource.com">View Patches</a></li>
        <li><a href="/source/life-of-a-bug.html">Life of a Bug</a></li>
        <li><a href="/source/report-bugs.html">Reporting Bugs</a></li>
        <li><a href="/source/code-style.html">Code Style Guidelines</a></li>
      </ul>
  </li>

  <li class="nav-section">
    <div class="nav-section-header empty">
      <a href="/source/community/index.html">
        <span class="en">Community</span>
      </a>
    </div>
  </li>

</ul>


      </div>
    </div> <!-- end side-nav -->
    <script>
      $(document).ready(function() {
        scrollIntoView("devdoc-nav");
        });
    </script>

  




<div class="col-12" id="doc-col" >


  
    
      
        <h1 itemprop="name" >Building for devices</h1>
      
    
  


  
  <div id="jd-content">


    <div class="jd-descr" itemprop="articleBody">
    <!--
    Copyright 2013 The Android Open Source Project

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<div id="qv-wrapper">
  <div id="qv">
    <h2>In this document</h2>
    <ol id="auto-toc">
    </ol>
  </div>
</div>

<p>This page complements the main page about
<a href="building-running.html">Building and Running</a> with
information that is specific to individual devices.</p>

<p>With the current release, it is possible to build for
Nexus 4, Nexus 7, and for some variants of Galaxy Nexus.
The exact level of functionality for each device depends on the availability
of the relevant proprietary hardware-specific binaries.</p>
<p>For Nexus 4 and Nexus 7, all configurations can be used,
and all the hardware is functional.
Due to hardware differences, do not use 4.1.1 on a Nexus 7 that
was originally sold with 4.1.2 or newer.</p>
<p>All configurations of Nexus 10 "manta" can be used with 4.2.2.
On those devices, graphics, audio,
Wi-Fi, Bluetooth, camera, NFC, GPS and orientation sensors are functional.</p>
<p>The variants of Galaxy Nexus that can be used are the GSM/HSPA+ configuration
"maguro" (only if it was originally sold with a "yakju" or "takju" operating
system) and the VZW CDMA/LTE configuration "toro". On those devices, graphics
and audio are functional, as well as Wi-Fi, Bluetooth, and access to the
respective cellular networks. NFC and the orientation sensors are functional.</p>
<p>The Sprint CDMA/LTE configuration "toroplus" of Galaxy Nexus is supported
experimentally, in the jb-mr1-dev-plus-aosp branch. On that configuration,
the cellular network is not functional,
and the other peripherals work like they do on "toro".</p>
<p>The Motorola Xoom can be used in the Wi-Fi configuration "wingray"
sold in the USA, with Android 4.1.2. Graphics and audio are functional
as well as Wi-Fi and Bluetooth and the orientation sensors.</p>
<p>All configurations of Nexus S and Nexus S 4G can be used with Android 4.1.2.
On those devices all the hardware is functional.</p>
<p>In addition, <a href="http://pandaboard.org">PandaBoard</a> a.k.a. "panda" can be used
in the jb-mr1-dev-plus-aosp branch, but is considered experimental.
The specific details to use a PandaBoard with the Android Open-Source Project
are in the file <code>device/ti/panda/README</code> in the source tree.</p>

<h2 id="building-fastboot-and-adb">Building fastboot and adb</h2>
<p>If you don't already have those tools, fastboot and adb can be built with
the regular build system. Follow the instructions on the page about
<a href="building-running.html">Building and Running</a>, and replace the main <code>make</code> command with</p>
<pre><code>$ make fastboot adb
</code></pre>
<h2 id="booting-into-fastboot-mode">Booting into fastboot mode</h2>
<p>During a cold boot, the following key combinations can be used to boot into fastboot mode,
which is a mode in the bootloader that can be used to flash the devices:</p>
<table>
<thead>
<tr>
<th>Device</th>
<th>Keys</th>
</tr>
</thead>
<tbody>
<tr>
<td>shamu</td>
<td>Press and hold <em>Volume Down</em>, then press and hold <em>Power</em></td>
</tr>
<tr>
<td>fugu</td>
<td>Press and hold <em>Power</em></td>
</tr>
<tr>
<td>volantis</td>
<td>Press and hold <em>Volume Down</em>, then press and hold <em>Power</em></td>
</tr>
<tr>
<td>hammerhead</td>
<td>Press and hold both <em>Volume Up</em> and <em>Volume Down</em>, then press
and hold <em>Power</em></td>
</tr>
<tr>
<td>flo</td>
<td>Press and hold <em>Volume Down</em>, then press and hold <em>Power</em></td>
</tr>
<tr>
<td>deb</td>
<td>Press and hold <em>Volume Down</em>, then press and hold <em>Power</em></td>
</tr>
<tr>
<td>manta</td>
<td>Press and hold both <em>Volume Up</em> and <em>Volume Down</em>, then press and hold <em>Power</em></td>
</tr>
<tr>
<td>mako</td>
<td>Press and hold <em>Volume Down</em>, then press and hold <em>Power</em></td>
</tr>
<tr>
<td>grouper</td>
<td>Press and hold <em>Volume Down</em>, then press and hold <em>Power</em></td>
</tr>
<tr>
<td>tilapia</td>
<td>Press and hold <em>Volume Down</em>, then press and hold <em>Power</em></td>
</tr>
<tr>
<td>phantasm</td>
<td>Power the device, cover it with one hand after the LEDs light up and until they turn red</td>
</tr>
<tr>
<td>maguro</td>
<td>Press and hold both <em>Volume Up</em> and <em>Volume Down</em>, then press and hold <em>Power</em></td>
</tr>
<tr>
<td>toro</td>
<td>Press and hold both <em>Volume Up</em> and <em>Volume Down</em>, then press and hold <em>Power</em></td>
</tr>
<tr>
<td>toroplus</td>
<td>Press and hold both <em>Volume Up</em> and <em>Volume Down</em>, then press and hold <em>Power</em></td>
</tr>
<tr>
<td>panda</td>
<td>Press and hold <em>Input</em>, then press <em>Power</em></td>
</tr>
<tr>
<td>wingray</td>
<td>Press and hold <em>Volume Down</em>, then press and hold <em>Power</em></td>
</tr>
<tr>
<td>crespo</td>
<td>Press and hold <em>Volume Up</em>, then press and hold <em>Power</em></td>
</tr>
<tr>
<td>crespo4g</td>
<td>Press and hold <em>Volume Up</em>, then press and hold <em>Power</em></td>
</tr>
</tbody>
</table>
<p>Also, the command <code>adb reboot bootloader</code> can be used to reboot from
Android directly into the bootloader with no key combinations.</p>
<h2 id="unlocking-the-bootloader">Unlocking the bootloader</h2>
<p>It's only possible to flash a custom system if the bootloader allows it.</p>
<p>The bootloader is locked by default. With the device in fastboot mode, the
bootloader is unlocked with</p>
<pre><code>$ fastboot oem unlock
</code></pre>
<p>The procedure must be confirmed on-screen, and deletes the user data for
privacy reasons. It only needs to be run once.</p>
<p>All data on the phone is erased, i.e. both the applications' private data
and the shared data that is accessible over USB, including photos and
movies. Be sure to make a backup of any precious files you have before
unlocking the bootloader.</p>
<p>On Nexus 10, after unlocking the bootloader, the internal storage is
left unformatted and must be formatted with</p>
<pre><code>$ fastboot format cache
$ fastboot format userdata
</code></pre>
<p>The bootloader can be locked back with</p>
<pre><code>$ fastboot oem lock
</code></pre>
<p>Note that this erases user data on Xoom (including the shared USB data).</p>
<h2 id="obtaining-proprietary-binaries">Obtaining proprietary binaries</h2>
<p>The Android Open-Source Project can't be used
from pure source code only, and requires additional hardware-related proprietary
libraries to run, specifically for hardware graphics acceleration.</p>
<p>Official binaries for the supported devices running tagged AOSP release
branches can be downloaded from <a
href="https://developers.google.com/android/nexus/drivers">Google's Nexus
driver page</a>. These add access to additional hardware capabilities with
non-open source code. To instead build the AOSP master branch, use the <a
href="https://developers.google.com/android/nexus/blobs-preview">Binaries
Preview for Nexus Devices</a>.</p>
<p>When building the master branch for a device, the binaries for the most
recent numbered release or with the most recent date are the ones that should
be used.</p>
<h3 id="extracting-the-proprietary-binaries">Extracting the proprietary binaries</h3>
<p>Each set of binaries comes as a self-extracting script in a compressed archive.
After uncompressing each archive, run the included self-extracting script
from the root of the source tree, confirm that you agree to the terms of the
enclosed license agreement, and the binaries and their matching makefiles
will get installed in the <code>vendor/</code> hierarchy of the source tree.</p>
<h3 id="cleaning-up-when-adding-proprietary-binaries">Cleaning up when adding proprietary binaries</h3>
<p>In order to make sure that the newly installed binaries are properly
taken into account after being extracted, the existing output of any previous
build needs to be deleted with</p>
<pre><code>$ make clobber
</code></pre>
<h2 id="picking-and-building-the-configuration-that-matches-a-device">Picking and building the configuration that matches a device</h2>
<p>The steps to configure and build the Android Open Source Project
are described in the <a href="building.html">Building</a> page.</p>
<p>The recommended builds for the various devices are available through
the lunch menu, accessed when running the <code>lunch</code> command with no arguments. Factory images and binaries for Nexus devices can be downloaded from:</p>
<p><a href="https://developers.google.com/android/nexus/images">https://developers.google.com/android/nexus/images</a></p>
<p><a href="https://developers.google.com/android/nexus/drivers">https://developers.google.com/android/nexus/drivers</a></p>
<table>
<thead>
<tr>
  <th>Device</th>
<th>Code name</th>
<th>Build configuration</th>
</tr>
</thead>
<tbody>
<tr>
  <td>Nexus 6</td>
<td>shamu</td>
<td>aosp_shamu-userdebug</td>
</tr>
</tr>
<tr>
  <td>Nexus Player</td>
<td>fugu</td>
<td>aosp_fugu-userdebug</td>
</tr>
<tr>
  <td>Nexus 9</td>
<td>volantis (flounder)</td>
<td>aosp_flounder-userdebug</td>
</tr>
<tr>
  <td>Nexus 5 (GSM/LTE)</td>
<td>hammerhead</td>
<td>aosp_hammerhead-userdebug</td>
</tr>
<tr>
  <td>Nexus 7 (Wi-Fi)</td>
<td>razor (flo)</td>
<td>aosp_flo-userdebug</td>
</tr>
<tr>
  <td>Nexus 7 (Mobile)</td>
<td>razorg (deb)</td>
<td>aosp_deb-userdebug</td>
</tr>
<tr>
  <td>Nexus 10</td>
<td>mantaray (manta)</td>
<td>full_manta-userdebug</td>
</tr>
<tr>
  <td>Nexus 4</td>
<td>occam (mako)</td>
<td>full_mako-userdebug</td>
</tr>
<tr>
  <td>Nexus 7 (Wi-Fi)</td>
<td>nakasi (grouper)</td>
<td>full_grouper-userdebug</td>
</tr>
<tr>
  <td>Nexus 7 (Mobile)</td>
<td>nakasig (tilapia)</td>
<td>full_tilapia-userdebug</td>
</tr>
<tr>
  <td>Galaxy Nexus (GSM/HSPA+)</td>
<td>yakju (maguro)</td>
<td>full_maguro-userdebug</td>
</tr>
<tr>
  <td>Galaxy Nexus (Verizon)</td>
<td>mysid (toro)</td>
<td>aosp_toro-userdebug</td>
</tr>
<tr>
  <td>Galaxy Nexus (Experimental)</td>
<td>mysidspr (toroplus)</td>
<td>aosp_toroplus-userdebug</td>
</tr>
<tr>
  <td>PandaBoard (Archived)</td>
<td>panda</td>
<td>aosp_panda-userdebug</td>
</tr>
<tr>
  <td>Motorola Xoom (U.S. Wi-Fi)</td>
<td>wingray</td>
<td>full_wingray-userdebug</td>
</tr>
<tr>
  <td>Nexus S</td>
<td>soju (crespo)</td>
<td>full_crespo-userdebug</td>
</tr>
<tr>
  <td>Nexus S 4G</td>
<td>sojus (crespo4g)</td>
<td>full_crespo4g-userdebug</td>
</tr>
</tbody>
</table>
<p>Do not use 4.1.1 on a Nexus 7 that was originally sold with 4.1.2
or newer.</p>
<h2 id="flashing-a-device">Flashing a device</h2>
<p>Set the device in fastboot mode if necessary (see above).</p>
<p>An entire Android system can be flashed in a single command: this writes
the boot, recovery and system partitions together after verifying that the
system being flashed is compatible with the installed bootloader and radio,
and reboots the system. This also erases all the user data, similarly to
<code>fastboot oem unlock</code> mentioned earlier.</p>
<pre><code>$ fastboot -w flashall
</code></pre>
<p>Note that filesystems created via fastboot on Motorola Xoom aren't working
optimally, and it is strongly recommended to re-create them through recovery</p>
<pre><code>$ adb reboot recovery
</code></pre>
<p>Once in recovery, open the menu (press Power + Volume Up), wipe the cache
partition, then wipe data.</p>
<h2 id="restoring-a-device-to-its-original-factory-state">Restoring a device to
its original factory state</h2>
<p>Factory images for Nexus 5, Nexus 10, Nexus 4, Nexus Q, Nexus 7, Galaxy
Nexus (GSM/HSPA+ "yakju" and "takju",
and CDMA/LTE "mysid" and "mysidspr"), Nexus S, and Nexus S 4G are available
from <a href="https://developers.google.com/android/nexus/images">Google's
factory image</a> page.</p>
<p>Factory images for the Motorola Xoom are distributed directly by Motorola.</p>

    </div>
      
      <div class="content-footer layout-content-row" 
                    itemscope itemtype="http://schema.org/SiteNavigationElement">
        <div class="layout-content-col col-9" style="padding-top:4px">
          
            <div class="g-plusone" data-size="medium"></div>
          
        </div>
        
        <div class="paging-links layout-content-col col-4">
          
        </div>
        
      </div>
      
      
      

  </div> <!-- end jd-content -->

<div id="footer" class="wrap" >
  <div id="copyright">
    
  Except as noted, this content is 
  licensed under <a href="http://creativecommons.org/licenses/by/2.5/">
  Creative Commons Attribution 2.5</a>. For details and 
  restrictions, see the <a href="/license.html">Content 
  License</a>.
  </div>
    <div id="footerlinks">
    
  <p>
    <a href="/source/index.html">About Android</a>&nbsp;&nbsp;|&nbsp;
    <a href="/source/community/index.html">Community</a>&nbsp;&nbsp;|&nbsp;
    <a href="/legal.html">Legal</a>&nbsp;&nbsp;|&nbsp;
  </p>
  </div>

</div><!-- end doc-content -->

</div> <!-- end body-content --> 






</body>
</html>



